package 行为型设计模式.责任链模式.demo;

/**
 * @Author lf
 * @Date 3/24/2024
 */
public class Client {
    public static void main(String[] args) {
        Handler handler1 = new ConcreteHandler1();
        Handler handler2 = new ConcreteHandler2();
        Handler handler3 = new ConcreteHandler3();

        handler1.setNext(handler2);
        handler2.setNext(handler3);

        int[] requests = {2, 5, 14, 22, 18, 3, 27, 20,28,29};

        for (int request : requests) {
            handler1.handleRequest(request);
        }
    }
}
